package ToYesterday.Day03;

public class corpFlightBookings {
    public static void main(String[] args) {
        int [][] books = {{1,2,10}, {2,2,15}};
        int n =2;
        int [] anser = new int[n];
        for (int i=0;i<books.length;i++){
            anser[books[i][0]-1] +=books[i][2];
            if (books[i][1]<=n-1){
                anser[books[i][1]] -= books[i][2];
            }
        }

//        for (int i=1;i<n;i++){
//            anser[i]=anser[i]+anser[i-1];
//        }
        for (int i =0;i<n;i++){
            if (i==0){
            }else {
                anser[i]=anser[i]+anser[i-1];
            }
        }
        for (int a:anser){
            System.out.println(a);
        }


    }


    public int[] corpFlightBookings(int[][] bookings, int n) {
        int [ ] h = new int[2];
        return h;
    }
}
